package metodos;
//import com.sun.org.apache.bcel.internal.generic.RETURN;
import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.JOptionPane;
import java.sql.*;

public class conectate {

   static String bd = "estcred";
   static String url = "jdbc:mysql://localhost/"+bd;
   static String login = "root";
   static String password = "";
   

   public conectate() 
           { 

      
           }  
      public Connection Conectar()
      {
          Connection link = null;
          try 
          {
         Class.forName("com.mysql.jdbc.Driver");
         link = DriverManager.getConnection(this.url, this.login, this.password);

         }
      catch (Exception ex)
      {
          JOptionPane.showMessageDialog(null, ex);
      }
      return link;
      }
}